/*  1:   */ package org.jetbrains.jsonProtocol;
/*  2:   */ 
/*  3:   */

import java.io.IOException;

/*  4:   */
/*  5:   */ 
/*  6:   */ public abstract class RequestImpl
/*  7:   */   extends OutMessage
/*  8:   */   implements Request
/*  9:   */ {
/* 10:   */   protected boolean argumentsObjectStarted;
/* 11:   */   
/* 12:   */   protected abstract String getIdKeyName();
/* 13:   */   
/* 14:   */   protected abstract String argumentsKeyName();
/* 15:   */   
/* 16:   */   protected final void beginArguments()
/* 17:   */     throws IOException
/* 18:   */   {
/* 19:14 */     if (!this.argumentsObjectStarted)
/* 20:   */     {
/* 21:15 */       this.argumentsObjectStarted = true;
/* 22:16 */       this.writer.name(argumentsKeyName());
/* 23:17 */       this.writer.beginObject();
/* 24:   */     }
/* 25:   */   }
/* 26:   */   
/* 27:   */   public final void finalize(int paramInt)
/* 28:   */   {
/* 29:   */     try
/* 30:   */     {
/* 31:24 */       if (this.argumentsObjectStarted) {
/* 32:25 */         this.writer.endObject();
/* 33:   */       }
/* 34:27 */       this.writer.name(getIdKeyName()).value(paramInt);
/* 35:28 */       this.writer.endObject();
/* 36:29 */       this.writer.close();
/* 37:   */     }
/* 38:   */     catch (IOException localIOException)
/* 39:   */     {
/* 40:32 */       throw new RuntimeException(localIOException);
/* 41:   */     }
/* 42:   */   }
/* 43:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jsonProtocol.RequestImpl

 * JD-Core Version:    0.7.0.1

 */